//
//  SGMeViewController.m
//  MomHelp
//
//  Created by xuguoyong on 16/8/11.
//  Copyright © 2016年 hudongkeji. All rights reserved.
//

#import "SGMeViewController.h"
@interface SGMeViewController ()<UITableViewDelegate,UITableViewDataSource>
@property (nonatomic,strong) UITableView *tabeView;
@property (nonatomic,strong) NSMutableArray *dataSource;

@end

@implementation SGMeViewController

- (NSMutableArray *)dataSource
{
    if (!_dataSource) {
        _dataSource = [[NSMutableArray alloc] init];
        [_dataSource addObject:@[@"用户信息"]];
        [_dataSource addObject:@[@"收藏"]];
        [_dataSource addObject:@[@"反馈与帮助",@"关于惠美"]];
    }
    return _dataSource;
}



- (void)viewDidLoad {
    [super viewDidLoad];
 
  self.tabeView  =  [self addTableViewWithDelegate:self style:UITableViewStyleGrouped];
  
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return self.dataSource.count;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    NSArray *arr = self.dataSource[section];
    return arr.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
    if (!cell) {
       cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"cell"];
    }
    
    
    NSString *title = self.dataSource[indexPath.section][indexPath.row];
    cell.textLabel.text = title;
    return cell;
    
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (indexPath.section == 0) {
        return 75.0f;
    }
    return 44.0f;
}

/*
- (void)test
{
    self.view.backgroundColor = SGRandomColor;
    
    UIButton *button = [UIButton custombuttonNormalStateWithTitile:@"测试" titleFont:nil titleColor:nil butttonImage:nil backgroundImage:nil backgroundColor:SGRandomColor clickThingTarget:self action:@selector(buttonCLick:)];
    [self.view addSubview:button];
    button.size = CGSizeMake(80, 80);
    button.centerX = self.view.centerX;
    button.centerY = 100;
    button.layer.cornerRadius = 40.0f;
    button.clipsToBounds = YES;
    _btn = button;
    
    view1 = [[UIView alloc] init];
    view1.backgroundColor = [UIColor redColor];
    view1.size = CGSizeMake(50, 50);
    view1.center = button.center;
    view1.layer.cornerRadius = 25.0f;
    view1.layer.masksToBounds  = YES;
    [self.view addSubview:view1];
    
    view2 = [[UIView alloc] init];
    view2.backgroundColor = [UIColor redColor];
    view2.size = CGSizeMake(50, 50);
    view2.center = button.center;
    view2.layer.cornerRadius = 25.0f;
    view2.layer.masksToBounds  = YES;
    [self.view addSubview:view2];
    
    view3 = [[UIView alloc] init];
    view3.backgroundColor = [UIColor redColor];
    view3.size = CGSizeMake(50, 50);
    view3.center = button.center;
    view3.layer.cornerRadius = 25.0f;
    view3.layer.masksToBounds  = YES;
    [self.view addSubview:view3];
    view4 = [[UIView alloc] init];
    view4.backgroundColor = [UIColor redColor];
    view4.size = CGSizeMake(50, 50);
    view4.center = button.center;
    view4.layer.cornerRadius = 25.0f;
    view4.layer.masksToBounds  = YES;
    [self.view addSubview:view4];
    
    
    view5 = [[UIView alloc] init];
    view5.backgroundColor = [UIColor redColor];
    view5.size = CGSizeMake(50, 50);
    view5.center = button.center;
    view5.layer.cornerRadius = 25.0f;
    view5.layer.masksToBounds  = YES;
    [self.view addSubview:view5];
}

- (void)buttonCLick:(UIButton *)sender
{
    
    SGLog(@"---");

    


}
-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    //[SGShowMesssageTool showMessage:@"当前版本不支持改功能，"];
    
    _btn.selected = !_btn.selected;
    
    if (_btn.selected) {
        [UIView animateWithDuration:0.25 animations:^{
            view1.transform = CGAffineTransformMakeTranslation(0, 100);
            view2.transform = CGAffineTransformMakeTranslation(95, -20);
            view3.transform = CGAffineTransformMakeTranslation(-95, -20);
            view4.transform = CGAffineTransformMakeTranslation(-75, 65);
            view5.transform = CGAffineTransformMakeTranslation(75, 65);
        }];
    }else
    {
        [UIView animateWithDuration:0.25 animations:^{
            view1.transform = CGAffineTransformIdentity;
            view2.transform = CGAffineTransformIdentity;
            view4.transform = CGAffineTransformIdentity;
            view3.transform = CGAffineTransformIdentity;
            view5.transform = CGAffineTransformIdentity;
        }];
        
    }

}

*/
@end
